<template>
<div class="comment-layout">
  <el-container>
    <el-header>
      <Top/>
    </el-header>
    <el-aside>
      <Menu/>
    </el-aside>
    <el-main>
      <el-row>
        <el-col>
          <el-upload ref="uploadRef" class="update-demo" action="http://locahost:8081/upload/test1"
          :auto-upload="false"
                     :on-success="ups"
          >
            <template #trigger>
              <el-button type="success">选择文件·</el-button>
            </template>
            <el-button class="ml-4" type="success" @click="submitUpload">点击上传</el-button>
            <div class="el_upload_tip">

            </div>

          </el-upload>
        </el-col>
      </el-row>
    </el-main>
    <el-table :data="stuList" stripe style="width: 100%">
      <el-table-column prop="id" label="学生id" width="180"></el-table-column>
      <el-table-column prop="name" label="学生姓名" width="180"></el-table-column>
      <el-table-column prop="age" label="年龄" width="180"></el-table-column>
    </el-table>
  </el-container>
</div>
</template>

<script>
import {onMounted, ref} from "vue";

const uploadRef=ref()
let submitUpload=()=>{
  uploadRef.value.submit()

}
let upsuccess=(res,file,fileList)=>{

}

let stuList=ref([])
let  query=()=>{
  let param={
    "pageNum":1,
    "pageSize":10
  }
  axios.get("test/stu/page",param).then(res=>{
    if (res.code===200){
      stuList.value=res.data;
    }
  })
}
onMounted(()=>{
  query();
})

</script>

<style scoped>

</style>